<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="wangyuguo">
		<title>$ui.x('SEL_ROLE_XUANZJS_5')</title>
		<script type="text/javascript" language="JavaScript" src="../script/common.js"></script>
		<script type="text/javascript" language="JavaScript" src="../script/tree.js"></script>
		<script type="text/javascript" language="JavaScript">
			var qt = null;
			var tree = null;
			var groupId = null;
			var treeType;
			var orgId;
			var org = Common.cOrg();
			var orgName;
			function load() {
				orgId = org.is;
				orgName =  getPara("orgName");
				searchForm.orgName.value = Common.cOrg().name;
				
				Eui.initBeginDateInput("beginDateTd","起始日期","searchForm","beginDate","endDate","_pastDate");
				Eui.initEndDateInput("endDateTd","结束日期","searchForm","beginDate","endDate","_pastDate");
				Common.initDict("colorType","colorType","全部");
				Common.initDict("neatness","neatness","全部");
				Common.initDict("certificateType","certificateType","全部");
				Common.initDict("diamondStatus","diamondStatus","全部");
				setPages(["listview","detview"]);
				createTable();
			}
			/**数据列表部分**/
			//生成表格，创建QueryTable对象
			function createTable() {
				
					var columns = []
					columns[0] = {
						type: "checkbox"
					}
					qt = new QueryTable("sel_diamond_query", "searchForm", "datalist", columns, {
						title: "钻石列表",
						columnsConf: false,
						showData: true
//						paramFunc: function(){
//							return {
//								orgId:org.id
//							};
//						}
					});
				
			}
			function searchSelOrg(){
				SystemMgnt.selOrg(function(sorg) {
						searchForm.orgName.value = sorg.name;
					});
			}
			
			function onSave() {			
				var obj = qt.getBoxValue(true);
				if (!obj||obj.length<1){
					showWarning("$ui.x('SEL_ROLE_QINGXZJS0_4')");return;
				}
//				alertAll(obj)
				dialogBackValue(obj);
			}
		</script>
	</head>
<body class="body" onload="load()">
	

<div id="listview">
	<div class="searchForm">
		<form id="searchForm" name="searchForm"><input type="hidden" id="location" name="location">
			<table cellSpacing=0 cellPadding=4 width="100%" border=0>
			
				<tr>
					<td><label>状态</label> <select name="diamondStatus"></select></td>
					<td><label>库存位置&nbsp;&nbsp;</label>
						<input type="text" name="orgName" maxlength="20" ><a class="orga" href="#" onclick="searchSelOrg();">&nbsp;&nbsp;</a>
					</td>
					<td><label>颜色</label> <select name="colorType"></select></td>
					<td><label>净度</label> <select name="neatness"></select></td>
				</tr>
				<tr>
					<td id="beginDateTd"></td>
					<td id="endDateTd"></td>
					<td><label>证书类型</label> <select name="certificateType"></select></td>
					<td><label>证书编号</label> <input type="text" name="certificateNo" onblur="" maxlength=24></td>
					<td><button type="button" onclick="qt.showTable();">查 询</button></td>
				</tr>
				<tr>
					<td id="purchaseBillIdTd"><input type="hidden" id="purchaseBillId" name="purchaseBillId"></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="datalist"></div>
</div>
</body>
</html>
